package br.com.utdd.hibernate;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.classic.Session;

import br.com.utdd.cadastro.dto.UsuarioDTO;

public class Pesquisa {

	public static void main(String[] args) {
		AnnotationConfiguration ac = new AnnotationConfiguration();
		ac.configure();

		SessionFactory factory = ac.buildSessionFactory();
		Session session = factory.openSession();

		List<UsuarioDTO> e = (List<UsuarioDTO>) session.load(UsuarioDTO.class, session);

		for (UsuarioDTO f : e) {
			System.out.println(f.getNome());
		}

	}
}
